﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

namespace Helpers
{
    public static class ExceptionHelper
    {
        public static void Throw(string msg)
        {
            throw new Exception(msg);
        }

        

        public static void CheckStringIsNullOrEmpty(string data, string paramName)
        {
            if (string.IsNullOrEmpty(data))
            {
                throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "{0}", new object[]
                {
                    paramName
                }));
            }
        }
        public static void TrueThrow(bool flag, string msg)
        {
            if (flag)
                Throw(msg);
        }

        public static void FalseThrow(bool flag, string msg)
        {
            TrueThrow(!flag, msg);
        }

    }
}
